package com.huawei.hms.auth.api.phone;

import android.app.Activity;
import android.content.Context;
import android.text.TextUtils;
import com.huawei.hms.a.a.a.a;
import com.huawei.hms.a.a.a.d;
import com.huawei.hms.a.a.a.f;
import com.huawei.hms.api.Api;
import com.huawei.hms.common.ApiException;
import com.huawei.hms.common.HuaweiApi;
import com.huawei.hms.common.internal.AbstractClientBuilder;
import com.huawei.hms.support.api.client.Status;
import com.huawei.hms.support.api.entity.hwid.HwIDConstant.RETCODE;
import com.huawei.hms.support.api.entity.hwid.HwIDNaming;
import o.fjo;
import o.fjx;

public class SmsRetrieverClient extends HuaweiApi<a> implements SmsRetrieverApi {
    protected SmsRetrieverClient(Activity activity, Api<a> api, a aVar, AbstractClientBuilder abstractClientBuilder) {
        super(activity, api, aVar, abstractClientBuilder);
    }

    protected SmsRetrieverClient(Context context, Api<a> api, a aVar, AbstractClientBuilder abstractClientBuilder) {
        super(context, api, aVar, abstractClientBuilder);
    }

    public fjo<Void> startSmsRetriever() {
        Object a = a().a();
        if (!TextUtils.isEmpty(a)) {
            return doWrite(new f(HwIDNaming.startSmsRetriever, a));
        }
        fjx o_fjx = new fjx();
        o_fjx.ॱ(new ApiException(new Status(RETCODE.SMS_RETRIEVER_PARAM_FAILED, RETCODE.SMS_PARAM_ERROR)));
        return o_fjx.ॱ();
    }

    private d a() {
        return new d(getContext().getPackageName());
    }
}
